{% extends "base.jinja" %}
{% block content %}
<div class="container">
  <div class="box">
                            {#- title and subtitle #}
    <div class="block">
      <p class="title is-4">{{ macros.render_element(index['title']) }}</p>
      {% if 'subtitle' in index %}<p class="subtitle is-6">{{ macros.render_element(index['subtitle']) }}</p>{% endif %}
    </div>
                            {#- index of the categories as tags #}
    <div class="tags">
    {% for category in index['categories'] -%}
      <span class="tag is-white {% if index['number_entries'][category] > index['number_entries_per_category_threshold'] %}is-size-5{% else %}is-size-6{% endif %}">
      {%- if category in index['category-icons'] %}{{ macros.render_element(index['category-icons'][category]) }}{% endif -%}
      <a href="#{{ category.lower() }}" class="has-text-weight-semibold">{{ macros.render_element(index['category-names'][category]) }}</a><span class="has-text-grey pl-1">({{ index['number_entries'][category] }})</span>
      </span>
    {%- endfor %}
    </div>
  </div>
                            {#- each of the categories one box #}
{% for category in index['categories'] %}
<div id="{{ category.lower() }}" class="box">
  <div class="block">
    <span class="title is-5">
    {%- if category in index['category-icons'] %}{{ macros.render_element(index['category-icons'][category]) }}{% endif %}
    {{ macros.render_element(index['category-names'][category]) }}</span>
    {%- if category in index['category-infos'] -%}<br>{{ macros.render_element(index['category-infos'][category]) }}{%- endif -%}
  </div>
  <div class="columns">
                            {#- each of the entry sets one column #}
  {%- for entries_column in index['entries'][category] -%}
    <div class="column">
      <ul>
                            {#- for each entry one link #}
      {%- for entry in entries_column -%}
        <li>{%- if entry['bold'] -%}<span class="has-text-weight-semibold">{%- endif -%}
            {{ macros.render_element(entry['url']) }}{%- if 'tags' in entry -%}{{ macros.render_element(entry['tags']) }}{%- endif -%}
            {%- if entry['bold'] -%}</span>{%- endif -%}</li>
      {%- endfor -%}
      </ul>
    </div>
  {%- endfor -%}
  </div>
  <p class="is-size-7 has-text-right"><a href="#">Back to top</a></p>
</div>
{%- endfor -%}
</div>
{% endblock %}